package com.java.bean;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.java.db.DBConnect;

public class LoginBean {
	public static ResultSet login(String name, String password) {
		ResultSet resultSet = null;
		try {
			Connection connection = DBConnect.getConnection();
			Statement statement = connection.createStatement();
			resultSet = statement
					.executeQuery("SELECT * FROM music.user where username='"
							+ name + "' and password ='" + password + "';");
			if (resultSet != null) {
				return resultSet;
			}
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return resultSet;
	}
}
